package com.lh.java.socket;

import java.io.*;
import java.net.*;

public class ClientPrimary {
	Socket socket;
	BufferedReader in;
	PrintWriter out;

	public ClientPrimary() {
		String address = "127.0.0.1";
		try {
			socket = new Socket(address, 10000);
			System.out.println("client get con");
			in = new BufferedReader(new InputStreamReader(
					socket.getInputStream()));
			out = new PrintWriter(socket.getOutputStream(), true);
			BufferedReader line = new BufferedReader(new InputStreamReader(
					System.in));
			out.println(line.readLine());
			line.close();
			out.close();
			in.close();
			socket.close();
		} catch (IOException e) {
		}
	}

	public static void main(String[] args) {
		new ClientPrimary();
	}
}